package com.one.group.admin.emailtool;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
import com.one.group.model.dto.SpSendEmailDto;
import org.springframework.stereotype.Component;

@Component
public class SendEmail {
    public Boolean sendEmail(SpSendEmailDto spSendEmailDto){
        try{
            MailUtil.send(spSendEmailDto.getEmail(), "智慧物业管理平台", spSendEmailDto.getContent(), true);
            return true;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
